function beforeSubmit(defaultParams) {
    return new Promise((resolve, reject) => {
        const self = this;
        const applyTable = self.$$("table_78pfc6");
        const selectedRowKeys = applyTable.rowSelection.selectedRowKeys;

        if (selectedRowKeys.length === 0) {
            self.$message.warning("请选择需要发起审核的人员");
            return resolve(false);
        }

        const cardIds = selectedRowKeys.join();

        saveCardIds({ cardIds, type: 1 }).then(res => {
            if (res.result) {
                window.APPLYID = res.result.id || 4;
                resolve(true);
            } else {
                self.$message.warning("保存失败");
                resolve(false);
            }
        }).catch(err => {
            self.$message.error("接口调用异常");
            reject(err);
        });
    });
}

/**
 * 保存选中的 cardIds
 * @param {Object} params - 包含 cardIds (string) 和 type (number)
 * @returns {Promise<Object>}
 */
function saveCardIds(params) {
    return new Promise((resolve, reject) => {
        api.DATA_SOURCE_EXECUTE(
            "ds_api:8ed92ede-82a0-4b4c-be3a-20f38006e2f5",
            "api", [], [], JSON.stringify(params)
        ).then(res => {
            resolve(JSON.parse(res));
        }).catch(reject);
    });
}
